package com.dm.learn

fun sum(a: Int, b: Int): Int {
    return a + b;
}

fun sum1(a: Int, b: Int) = a + b

fun printSum(a: Int, b: Int) {
    println("sum of $a and $b is ${a + b}")
}

fun printSum1(a: Int, b: Int) {
    println("sum of $a and $b is ${a + b}")
}

fun maxOf(a: Int, b: Int) = if (a > b) a else b
//可重新赋值的变量使用 var 关键字：
var a: Int = 1;
val b = 1;

fun main() {
    print("Sum of 3 and 5 is ")
    println(sum(3, 5))
    println(sum1(3, 5))
    printSum(-1, 8)
    printSum1(-1, 8)
    println(maxOf(1,5))
}